package com.elvt.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elvt.server.mapper.EmployeeEcMapper;
import com.elvt.server.pojo.Employee;
import com.elvt.server.pojo.EmployeeEc;
import com.elvt.server.service.IEmployeeEcService;
import com.elvt.server.utils.RespPageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 作者：elvt
 * @since 2022-05-21
 */
@Service
public class EmployeeEcServiceImpl extends ServiceImpl<EmployeeEcMapper, EmployeeEc> implements IEmployeeEcService {
    @Autowired
    private EmployeeEcMapper employeeEcMapper;

    @Override
    public RespPageUtil findEmpEc(Integer currentPage, Integer size) {
        Page<EmployeeEc> page = new Page<>(currentPage, size);
        IPage<EmployeeEc> iPage = employeeEcMapper.findEmpEc(page);
        RespPageUtil respPageUtil = new RespPageUtil(iPage.getTotal(), iPage.getRecords());
        return respPageUtil;
    }
}
